/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ManagedBeans;

import java.util.ArrayList;
import java.util.List;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import javax.faces.context.FacesContext;
import javax.faces.model.SelectItem;
import javax.servlet.http.HttpServletResponse;

/**
 *
 * @author Joni
 */
@ManagedBean
@SessionScoped
public class mbPlantilla {

    private String plantilla = "zara";

    public mbPlantilla() {
    }

    public void cambiarPlantilla() {
        try {
            FacesContext.getCurrentInstance().getExternalContext().redirect("/Tienda_asalinero/faces/front/inicio.xhtml");
        } catch (Exception e) {
            System.err.println("Error en la redirección");
        }
    }

    public List<SelectItem> getPlantillas() {
        ArrayList<SelectItem> lista = new ArrayList<SelectItem>();
        lista.add(new SelectItem("zara", "Zara"));
        lista.add(new SelectItem("alcampo", "Alcampo"));
        return lista;
    }

    /**
     * @return the plantilla
     */
    public String getPlantilla() {
        return plantilla;
    }

    /**
     * @param plantilla the plantilla to set
     */
    public void setPlantilla(String plantilla) {
        this.plantilla = plantilla;
    }
}
